find inverses of functions